package com.yuhang.demo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuhang.demo.entity.RuleDrugRelation;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface RuleDrugRelationMapper extends BaseMapper<RuleDrugRelation> {
    /**
     * 根据规则ID分页查询药品关联列表
     * @param page 分页参数
     * @param ruleId 规则ID
     * @return 分页结果
     */
    IPage<RuleDrugRelation> selectByRuleIdPage(Page<RuleDrugRelation> page, @Param("ruleId") Long ruleId);

    /**
     * 根据规则ID查询药品关联数量
     * @param ruleId 规则ID
     * @return 关联数量
     */
    Integer selectCountByRuleId(@Param("ruleId") Long ruleId);
}
